package com.lace.security.jwt;

import com.lace.security.jwt.constant.SecurityConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Map;
/**
 * Created by WangZX on 2018/7/14.
 */
@ConfigurationProperties(prefix = "lace.security", ignoreUnknownFields = true)
public class SecurityProperties {

	private String[] permitUrl;

	private String[] protectUrl = {"/**"};

	private Map<String,String[]> rolesUrl;

	private Integer tokenExpirationTime = SecurityConstant.DEFAULT_TOKEN_EXP_TIME;

	private Integer refreshTokenExpTime = SecurityConstant.DEFAULT_REFRESH_TOKEN_EXP_TIME;

	private String encoderType;

	private String tokenSigningKey = SecurityConstant.DEFAULT_TOKEN_SIGN_INGKEY;

	private String tokenHeaderParam = SecurityConstant.DEFAULT_TOKEN_HEADER;

	private String loginProcessUrl = SecurityConstant.DEFAULT_LOGIN_PROCESSING_URL_FORM;

	public Integer getRefreshTokenExpTime() {
		return refreshTokenExpTime;
	}

	public void setRefreshTokenExpTime(Integer refreshTokenExpTime) {
		this.refreshTokenExpTime = refreshTokenExpTime;
	}

	public Integer getTokenExpirationTime() {
		return tokenExpirationTime;
	}

	public void setTokenExpirationTime(Integer tokenExpirationTime) {
		this.tokenExpirationTime = tokenExpirationTime;
	}

	public String getTokenSigningKey() {
		return tokenSigningKey;
	}

	public void setTokenSigningKey(String tokenSigningKey) {
		this.tokenSigningKey = tokenSigningKey;
	}

	public String getTokenHeaderParam() {
		return tokenHeaderParam;
	}

	public void setTokenHeaderParam(String tokenHeaderParam) {
		this.tokenHeaderParam = tokenHeaderParam;
	}

	public String[] getPermitUrl() {
		return permitUrl;
	}

	public void setPermitUrl(String[] permitUrl) {
		this.permitUrl = permitUrl;
	}

	public Map<String, String[]> getRolesUrl() {
		return rolesUrl;
	}

	public void setRolesUrl(Map<String, String[]> rolesUrl) {
		this.rolesUrl = rolesUrl;
	}

	public String getEncoderType() {
		return encoderType;
	}

	public void setEncoderType(String encoderType) {
		this.encoderType = encoderType;
	}

	public String getLoginProcessUrl() {
		return loginProcessUrl;
	}

	public String[] getProtectUrl() {
		return protectUrl;
	}

	public void setProtectUrl(String[] protectUrl) {
		this.protectUrl = protectUrl;
	}

	public void setLoginProcessUrl(String loginProcessUrl) {
		this.loginProcessUrl = loginProcessUrl;
	}
}
